Skip to content

Conversation

@SaurabhJain708
Copy link

@SaurabhJain708 SaurabhJain708 commented Sep 5, 2025

Description

The AI now responds with an array of JSON objects instead of a diff. This array is looped through and processed by the Morph API.

This change is a significant improvement because it provides a more robust and atomic way to handle updates. Unlike a diff, which relies on comparing two states and can be susceptible to race conditions and errors, the new approach sends a complete, self-contained set of instructions. This ensures that changes are applied correctly and in the intended order, making the system more reliable and easier to debug.

Additional Changes

  • Patched failing unit tests to ensure the stability and accuracy of the new system.

Important

Integrates Morph API for JSON-based code editing, replacing diff-based approach, and updates tests accordingly.

  • Behavior:
    • Replaces diff-based code editing with JSON-based instructions processed by Morph API in steps.py.
    • Adds apply_morph_edit() function to send instructions to Morph API and return merged code.
    • Updates improve_fn() and _improve_loop() to handle JSON instructions.
  • Preprompts:
    • Updates file_format_diff to specify JSON output format for code edits.
    • Modifies improve preprompt to remove diff syntax instructions.
  • Tests:
    • Updates test_cli_agent.py, test_simple_agent.py, and test_steps.py to mock Morph API calls and validate JSON-based editing.
    • Removes test_salvage_correct_hunks.py as it is no longer relevant.

This description was created by Ellipsis for 6856b84. You can customize this summary. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to 6856b84 in 1 minute and 41 seconds. Click for details.
  • Reviewed 563 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .env.template:6
  • Draft comment:
    Ensure MORPH_API_KEY is configured securely and not exposed in production.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. gpt_engineer/core/default/steps.py:354
  • Draft comment:
    Verify that the new JSON-based improvement approach fully covers edge cases previously handled by salvage_correct_hunks.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to verify that the new approach covers edge cases, which falls under asking the author to ensure behavior is intended or tested. This violates the rules.
3. gpt_engineer/preprompts/file_format_diff:1
  • Draft comment:
    Ensure downstream components expect the updated JSON output format as described in the new preprompt instructions.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. tests/core/test_salvage_correct_hunks.py:1
  • Draft comment:
    Removal of tests in test_salvage_correct_hunks.py is intentional; ensure that all diff-based edge cases are now covered by JSON-based tests.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. gpt_engineer/preprompts/file_format_diff:39
  • Draft comment:
    Typographical error: 'dont' should be corrected to "don't" on line 39.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the comment is technically correct about the missing apostrophe, this is a very minor issue. The meaning is completely clear without the apostrophe. This is a documentation file, not code, and the typo doesn't affect functionality. The comment doesn't suggest any meaningful code changes. The typo could be seen as unprofessional in documentation. Also, since this is a prompt file, precise language might be important for AI interaction. Even for AI interaction, this minor typo won't affect functionality - the meaning is unambiguous. We should focus on more substantial issues. Delete the comment as it points out an extremely minor typographical issue that doesn't affect functionality or clarity.
6. gpt_engineer/preprompts/improve:2
  • Draft comment:
    The sentence on this line has a couple of typographical issues: 1. The word "First" following the comma should be lowercase (i.e. "first"). 2. Similarly, "As well" should not be capitalized (i.e. "as well"). Consider revising the sentence to: "Make changes to existing code. When implementing new code, first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose."
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_5BrQKlQcDcsHoSoN

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant